/* creat.c
 *	Simple program to test whether creating program works.
 *	
 *	Creates a file if all is well
 *
 */

#include "syscall.h"

char buff[5];

int
main()
{
    int id = creat("createdfile.txt");
    unlink("createdfile.txt");
    int i;
    int error = open("createdfile.txt");
    int eId = creat("error.txt");
    if (error == -1)
        buff[0] = '1';
    else
        buff[0] = '0';
    write(eId,buff,1);
    for (i = 0;i < 100000; i += 2)
        i--;
    close(id);
    halt();
}

